<?php
/**
 * sputメソッドのテスト
 * 
 * @since 2012/04/03
 */
class TestofYuTorisPut extends UnitTestCase {
	public function __construct () {
	}

	public function TestofCallable() {
		$y = YuTori::factory('test', 'originalName');

		$res = $y->sput();
		$this->assertIdentical($res, 'test', '無指定のsput');
		$y->set (null);
		$res = $y->sput('noResult=NULL');
		$this->assertIdentical($res, 'NULL', 'noResult指定null時のsput');
		$y->set ('test');
		$res = $y->sput('noResult=NULL');
		$this->assertIdentical($res, 'test', 'noResult指定非null時のsput');
		$y->set (5);
		$res = $y->sput('format=%03d');
		$this->assertIdentical($res, '005', 'format指定のsput');
		$y->set (null);
		$res = $y->sput('noResult=5','format=%03d');
		$this->assertIdentical($res, '005', 'noResult、format指定のsput');
	}
}
